<?php

require SMARTY_DIR.'Smarty.class.php';

class View extends Smarty{
	
	function __construct(){
		parent::__construct();
		$this->compile_dir = VIEW.'template_c'.DS;
	}
	
	public function render($name){
		$name = explode('/',$name);
		$template_dir = array_shift($name);
		$template = array_shift($name);
		$this->assign('header',VIEW.'header.tpl');
		$this->assign('footer',VIEW.'footer.tpl');
		$this->template_dir = VIEW.$template_dir.DS;
		$this->display($template.'.tpl');
	}
	
}

?>